import { createVNode, render } from 'vue'
import UbtNote from './UbtNotify.vue'

const noteMain = document.createElement('div')
document.body.appendChild(noteMain)
 
let showTime = null
export default ({kind, title, txt}) => {
  const noteNode = createVNode(UbtNote, {kind, title, txt})
  render(noteNode, noteMain)
  
  clearTimeout(showTime)
  showTime = setTimeout(() => {
    render(null, noteMain)
  }, 3000)
}
